#include <iostream>
#include <math.h>
using namespace std;

int main(){
    cout << "a      a^2    a^3" << endl;
    cout << pow(1,1) << "      " << pow(1,2) << "      " << pow(1,3) << endl;
    cout << pow(2,1) << "      " << pow(2,2) << "      " << pow(2,3) << endl;
    cout << pow(3,1) << "      " << pow(3,2) << "      " << pow(3,3) << endl;
    cout << pow(4,1) << "      " << pow(4,2) << "     " << pow(4,3) << endl;
    return 0;
}
